package com.iot.core.model;

import java.util.Date;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.cassandra.core.PrimaryKeyType;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.cassandra.mapping.PrimaryKeyClass;
import org.springframework.data.cassandra.mapping.PrimaryKeyColumn;

import com.witsight.platform.model.IBaseObject;
/**   
 * 说明：TransactionKey
 * @Title: TransactionKey.java 
 * @Package com.witsight.cassandra.util.model 
 * @See: {@link IBaseObject}
 * Copyright: Copyright (c) 2017
 * Company:sany huax witsight team by product
 * @author: penght  
 * @date: 2017年9月21日 下午2:59:58 
 * @version: V1.0
 *
 */
@PrimaryKeyClass
public class TransactionKey  implements IBaseObject {
	//serialVersionUID
	private static final long serialVersionUID = 3517706413147472456L;	
	
	//productCategory
	@PrimaryKeyColumn(name = "productcategory", ordinal = 0, type = PrimaryKeyType.PARTITIONED)
    private Integer productCategory;
	
	//submissiontime
	@PrimaryKeyColumn(name = "submissiontime", ordinal = 0, type = PrimaryKeyType.CLUSTERED)
	private Date submissionTime;
	
	//resolution
	@PrimaryKeyColumn(name = "resolution", ordinal = 0, type = PrimaryKeyType.CLUSTERED)
	private Integer resolution;
	
	//pos
	@PrimaryKeyColumn(name = "pos", ordinal = 0, type = PrimaryKeyType.CLUSTERED)
	private Integer pos;
	
	//id
	@PrimaryKeyColumn(name = "id", ordinal = 0, type = PrimaryKeyType.CLUSTERED)
	private Integer id;
	
	public Integer getResolution() {
		return resolution;
	}
	public void setResolution(Integer resolution) {
		this.resolution = resolution;
	}
	public Integer getPos() {
		return pos;
	}
	public void setPos(Integer pos) {
		this.pos = pos;
	}
	public Integer getProductCategory() {
		return productCategory;
	}
	public void setProductCategory(Integer productCategory) {
		this.productCategory = productCategory;
	}
	@LastModifiedDate
	public Date getSubmissionTime() {
		return submissionTime;
	}
	public void setSubmissionTime(Date submissionTime) {
		this.submissionTime = submissionTime;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	
	@Override
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.SIMPLE_STYLE)
				.append(super.toString())
				.append(this.productCategory)
				.append(this.submissionTime)
				.append(this.resolution)
				.append(this.pos)
				.append(this.id)
				.toString();
	}
}
